<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<html>
<head>
<jsp:useBean id="MESSAGE" class="java.lang.String" scope="request"/>
<title>Bookstore</title>
<script>

	
	function OpenImg(imgId)
	{
		var obj = document.getElementById('imageId');
		obj.value= imgId;
		document.forms[0].call.value = 'loadModify';
	
		document.forms[0].submit();
	}
	
	function Upload()
	{
		document.forms[0].call.value = 'upload';
		document.forms[0].submit();
	}



	
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="/bookstore/default.css" />
</head>
<body bgcolor="maroon" scrol="no" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (all.psd) -->
<table id="Table_01" width="718"  border="0" cellpadding="0" cellspacing="0" align=center>
	<tr>
		<td colspan="3">
		<img src="/bookstore/images/all_01.jpg" width="718" height="167" alt="">	
		</td>
	</tr>
	<tr>
		<td>
			<div id="menu" align=center>	
				<jsp:include page="adminmenu.jsp"/>
		  </div>	
		</td>
	</tr>
	<tr>
		<td colspan="3">
		<div id="content">	
		

<form method="post" name=frm action="/bookstore/uploaditem.do" enctype="multipart/form-data" >

 <html:hidden name="UploadItemForm" property="shopid" />
 <input type="hidden" id="imageId"  name="imageId" value="" />
 
 <input type="hidden" name="call" value="upload" />
 


 



<div id="centent">

<p class="pheading1">Manage Books</p>
<bean:write name='MESSAGE'/> 
<p class="pheading2">Recently Added Books [click the icon to view details]</p>
<table cellpadding="0" cellspacing="4" class=contentable>

<tr>
<td colspan=2>
 <bean:define id="shopid"  name="UploadItemForm" property="shopid"/>
 <logic:iterate id="imgs" name="UploadItemForm" property="imageList"> 
 <!--div id="thumbnailImages" valign="middle"  -->
	<img style="border:1px solid gray;margin-left:4px;cursor:pointer" height="50px" width="50px" valign="middle"  onClick="OpenImg('<%=imgs %>')" src="<%= ("gallery/" +shopid+ "/thumb_" + imgs) %>" ></img>
	
<!--/div-->
 </logic:iterate>

</td>

</tr>

<tr>
<td colspan="2" >

<br/>
<b class="pheading2" style="padding-left:0">New Book Details</b>
</td>
</tr>
<tr>
       <td>Select Category</td>
       <td><select name="categoryid">
	  <bean id="categorylist" name="categorylist" scope="request"/>
<logic:iterate id="categ" name="categorylist">
<option value="<bean:write name="categ" property="categoryid"/>">
<bean:write name="categ" property="categoryname"/>
</option>
</logic:iterate>


	   </select></td>
</tr>
<tr>
       <td>Image Location</td>
       <td><input size="40" type="file"  name="photo"></td>
</tr>
<tr>
       <td></td>
       <td>(only JPG, BMP, GIF)</td>
</tr>
<tr>
       <td>Name</td>
       <td><input size="20" type="text" name="name"></td>
</tr>
<tr>
       <td>ISBN</td>
       <td><input size="20" type="text" name="isbn"></td>
</tr>
<tr>
       <td>Publisher</td>
       <td><input size="20" type="text" name="publisher"></td>
</tr>
<tr>
       <td>Author</td>
       <td><input size="20" type="text" name="author"></td>
</tr>
<tr>
       <td>Year of Publishing</td>
       <td><input size="20" type="text" name="year"></td>
</tr>
<tr>
       <td>Edition</td>
       <td><input size="20" type="text" name="edition"></td>
</tr>
<tr>
       <td>Price</td>
       <td><input size="20" type="text" name="price"></td>
</tr>
<tr>
       <td>Description</td>
       <td><textarea rows="5" cols="30"	   name="description"></textarea></td>
</tr>

<tr>
       <td>&nbsp;</td>
       <td><input type="button" class=btn onClick="Upload()" value="Upload" /></td>
</tr>

</table>

</div>
</form>



		</div>
		</td>
	</tr>
	<tr>
		<td colspan="3">
			<div id=footer><img src="/bookstore/images/all_06.jpg" width="718" height="17" alt="">
			</div>
			</td>
	</tr>
	
</table>
<!-- End ImageReady Slices -->
</body>
</html>